<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:p="http://primefaces.org/ui"> 

<h:head><title>TravelDream</title>
	<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>
</h:head> 
<body> 

	
	<h:outputStylesheet library="css" name="primefaces-style.css"/>

	<p:panel header="Admin Console">
		<h:panelGrid columns="10" cellpadding="3">
			<h:link outcome="homePage" value="Admin Console"/>
			
			 <h:link outcome="createTravelPackage" value="new package" />  
			  
			  <h:link outcome="newFlight" value="new flight"/>
			  
			  <h:link outcome="newHotel" value="new hotel"/> 
			  
			  <h:link outcome="newExcursion" value="new excursion"/>
			  
			  <h:link outcome="showAllPackages" value="show all packages" /> 
			 
			  <h:link outcome="showAllHotels" value="show All Hotels"/> 
			   
			  <h:link outcome="showAllFlights" value="show All flights"/>
			   
			  <h:link outcome="showExcursion" value="show excursions"/> 

			  <h:outputText value="manage city" />  
			  
	 
			  <h:form>
				<p:commandButton id="logoutButton" value="logout" action="#{logout.logout()}"/>
			</h:form>
		</h:panelGrid>
	</p:panel>
	
	
	<p:panel header="Add city">
	<h:form>
		<p:outputLabel for="cityToAdd" value="City" />
		<p:inputText id="cityToAdd" value="#{cityBean.cityDTO.city}" />		
		<p:commandButton value="add" action="#{cityBean.add()}" ajax="false"/>
		<h:message for="cityToAdd"/>
		
		<h:outputText value="#{cityBean.errorName}" />
	
	</h:form>
	</p:panel>
	
	
	
	<h:form>  
		    <p:dataTable id="cities" var="CityDTO" value="#{cityBean.allCityList}" >  
		    	 <f:facet name="header">  
          				  	All Cities  
       					 </f:facet> 
			       <p:column headerText="Id">  
			            <h:outputText value="#{CityDTO.id}" />  
			       </p:column>  
			     
			     <p:column id="cityColumn" filterBy="city"   
             	   	headerText="City"   
              	 	 filterMatchMode="contains">  
        		    <h:outputText value="#{CityDTO.city}" />  
        		</p:column>  
			     
			       <p:column headerText="">  
			            <p:commandButton value="edit" action="#{cityBean.editCity(CityDTO)}" /> 
			        </p:column>
			        
			         <p:column headerText="">  
			        <p:commandButton value="Delete" action="#{cityBean.removeCity(CityDTO)}" update="cities"/>
			        </p:column>
			     		  
    	</p:dataTable>  
	</h:form>  

</body> 
</html>

